#ifndef __SCC_SCCILP_H
#define __SCC_SCCILP_H

#define LCM_FILENAME            ("/flash/RapIB311XetalLcm")

///////////////////
// DEBUG STUFF
///////////////////
// uncomment the following line to display (and hang afterwards) all errors from RAP_CALLS
#define _DEBUG_
// uncomment the following line to display all RAP_CALLS; _DEBUG_ must be defined
//#define _DEBUG_SHOW_ALL_RAP_CALLS_

///////////////////

#ifndef _DEBUG_
	#define RAP_CALL(func)	(func)
#else 
	#ifdef _DEBUG_SHOW_ALL_RAP_CALLS_
		#define RAP_CALL(func)		\
		{       					\
			int _errStat = func;	\
		    if( _errStat != RAP_ERROR_NONE)		\
		    { 									\
		        fprintf( stderr, "\n*** Rhapsody Call '%s' failed. ***\nError Status:\t%x\nFile:\t\t%s\nLine:\t\t%d\n", #func, _errStat, __FILE__, __LINE__ );	\
		        while(_errStat != RAP_ERROR_NONE);	\
		    }						\
		    else	\
		    {		\
		    	printf("- %s succesful.\n", #func);	\
		    }		\
		}							
	#else
		#define RAP_CALL(func)		\
		{       					\
			int _errStat = func;	\
		    if( _errStat != RAP_ERROR_NONE)		\
		    { 									\
		        fprintf( stderr, "\n*** Rhapsody Call '%s' failed. ***\nError Status:\t%x\nFile:\t\t%s\nLine:\t\t%d\n", #func, _errStat, __FILE__, __LINE__ );	\
		        while(_errStat != RAP_ERROR_NONE);	\
		    }						\
		}							
	#endif
#endif

#endif /* __SCC_SCCILP_H */
